home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_091 / include / adlprog.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  4KB  |  125 lines

  1. #define NUMPROP 32            /* Max # of object properties    */
  2.  
  3. /* Structure of an object */
  4. struct objrec {
  5.     int16    loc,            /* obj index            */
  6.         cont,            /* obj index            */
  7.         link,            /* obj index            */
  8.         adj,            /* adj index            */
  9.         others,            /* obj index            */
  10.         noun,            /* noun index            */
  11.         props1to16,        /* 0 or 1            */
  12.         props[ NUMPROP - 16 ];    /* General props        */
  13. }; /* 44 bytes */
  14.  
  15. /* Structure of a verb */
  16. struct verbrec {
  17.     int16    preact,            /* rout index            */
  18.         postact;        /* rout index            */
  19. }; /* 4 bytes */
  20.  
  21. /* Structure of a verb-prep synonym */
  22. struct vp_syn {
  23.     int16    vrb,            /* Verb index            */
  24.         prp,            /* Prep index            */
  25.         val;            /* Verb index            */
  26. }; /* 6 bytes */
  27.  
  28. /* Structure of a multi-word preposition ("in front of") */
  29. struct preprec {
  30.     int16    first,            /* Prep #            */
  31.         obj,            /* Object #            */
  32.         last,            /* Prep #            */
  33.         val;            /* Prep #            */
  34. }; /* 8 bytes */
  35.  
  36.  
  37. /* "Directory" of compiled dungeon */
  38. struct adldir {
  39.     int16    numobjs,        /* Number of objects        */
  40.         objsize;        /* Size of an object        */
  41.     int32    ptr;            /* Lseek index into the file    */
  42. }; /* 8 bytes */
  43.  
  44.  
  45. /* Structure of a symbol */
  46. #define LENGTH 8            /* Maximum symbol name length    */
  47. struct symbol {
  48.     char
  49.     first,                /* Was this the first symbol?    */
  50.     name[ LENGTH + 1 ];        /* Name of the symbol        */
  51.     int16
  52.     type,                /* Type (NOUN, ADJEC, etc.)    */
  53.     val;                /* Value            */
  54. }; /* 14 bytes */
  55.  
  56. /* Header of an ADL executable file */
  57. struct header {
  58.     char        adlname[ 80 ];    /* Hack for BSD systems        */
  59.     struct    adldir    codeindex,    /* Index for the code        */
  60.             strtabindex,    /* Index for the string tab    */
  61.             strindex,    /* Index for the strings    */
  62.             symindex,    /* Index for the sym table    */
  63.             verbindex,    /* Index for the verbs        */
  64.             objindex,    /* Index for the objects    */
  65.             nounindex,    /* Index for the nouns        */
  66.             varindex,    /* Index for the vars        */
  67.             prepindex,    /* Index for the preps        */
  68.             vsindex,    /* Index for the verb syns    */
  69.             routindex;    /* Index for the routines    */
  70.     int32        adlid,        /* Timestamp            */
  71.             magic;        /* Magic number            */
  72. };
  73.  
  74. extern    struct    verbrec        *verbspace;    /* Verb contents    */
  75. extern    struct    objrec        *objspace;    /* Object contents    */
  76. extern    struct    preprec        *prepspace;    /* Preposition contents    */
  77. extern    struct    vp_syn        *verbsyn;    /* Verb synonyms    */
  78. extern    int16            *varspace;    /* Stack & variables    */
  79. extern    int16            *nounspace;    /* Noun indices        */
  80. extern    address            *routspace;    /* Routine indices    */
  81. extern    int32            *str_tab;    /* String table        */
  82.  
  83. extern    struct    header        hdr;        /* Global header struct    */
  84.  
  85. /* Some #defines to make life easier */
  86.  
  87. #define NUMNOUN        hdr.nounindex.numobjs
  88. #define NUMSYM        hdr.symindex.numobjs
  89. #define NUMVERB        hdr.verbindex.numobjs
  90. #define NUMOBJ        hdr.objindex.numobjs
  91. #define NUMVAR        hdr.varindex.numobjs
  92. #define NUMROUT        hdr.routindex.numobjs
  93. #define NUMSTR        hdr.strtabindex.numobjs
  94. #define NUMPP        hdr.prepindex.numobjs
  95. #define NUMVS        hdr.vsindex.numobjs
  96.  
  97.  
  98. /* Predefined stuff */
  99.  
  100. #define M_ADL    0x0ad10ad1L            /* Adl magic number    */
  101.  
  102. #define _START    1                /* Rout # for START    */
  103. #define _DWIMI    2                /* Rout # for DWIMI    */
  104. #define _DWIMD    3                /* Rout # for DWIMD    */
  105.  
  106. #define _NOVERB 0                /* Verb # for NOVERB    */
  107. #define _TELLER    1                /* Verb # for TELLER    */
  108.  
  109. #define _ALL    0                /* Obj # for .ALL    */
  110. #define _STRING    1                /* Obj # for STRING    */
  111.  
  112. #define _ACT    NUMPROP                /* Prop # for ACTION    */
  113. #define _LD    (_ACT - 2)            /* Prop # for LDESC    */
  114. #define _SD    (_ACT - 1)            /* Prop # for SDESC    */
  115. #define _PREACT    (_ACT + 1)            /* Prop # for PREACT    */
  116.  
  117. #define _VERB_G -1                /* Glob # for Verb    */
  118. #define _DOBJ_G -2                /* Glob # for Dobj    */
  119. #define _IOBJ_G -3                /* Glob # for Iobj    */
  120. #define _PREP_G -4                /* Glob # for Prep    */
  121. #define _CONJ_G -5                /* Glob # for Conj    */
  122. #define _NUMD_G -6                /* Glob # for Numd    */
  123.  
  124. /*** EOF adlprog.h ***/
  125.